<?php
namespace app\admin\validate;

use think\Validate;

class ModelField extends Validate
{
         protected $rule =   [
            'field_cnname'  => 'require|unique:model_field',
            'field_enname'   => 'require|unique:model_field',
            'model_id' =>'require',
            'field_type' =>'require',

        ];

        protected $message  =   [
           'field_cnname.require' =>'字段中文名称不得为空！',  
           'field_cnname.unique' =>'字段中文名称不得重复',

           'field_enname.require' =>'字段英文名称不得为空！',
           'field_enname.unique' =>'字段英文名称不得重复',

           'model_id' => '所属模型不得为空！',
           'field_type' => '字段类型不得为空！',
           



        ];

        protected $scene = [
            'edit'  => ['field_enname','field_cnname','field_type'],
            'add'  => ['field_enname','field_cnname','model_id','field_type'],
        ];

}












?>